// pages/conference/conference.js
//index.js
//获取应用实例
const app = getApp()
var APP_URL = 'http://www.gconfs.com/index/search.do'
Page({
  data: {
    conference:[],
    industy:[],
    imgUrls: [
      'http://wimg.huodongxing.com/logo/201808/9451853114700/313156460441332_v2.jpg@!wmlogo?auth_key=1535578664-0-0-694748d4aaf58174a70dcad47518aecb',
      'http://cdn.huodongxing.com/Content/app/appom/803160466500877.jpg',
      'http://cdn.huodongxing.com/Content/app/appom/843163615584628.jpg',
      'http://cdn.huodongxing.com/Content/app/appom/783161442713056.jpg'
    ],
    imgHead:'http://www.gconfs.com/img/news01.jpg',
    location:'../../images/location.png',
    search:'../../images/search.png',
    sao:'../../images/sao.png',
    indicatorDots: true,
    autoplay: true,
    interval: 5000,
    duration: 1000
  },
  toDetail(event){
    // console.log(event)
    var postad = event.currentTarget.dataset.postad;//获取传递值
    // console.log(postad);
    wx.navigateTo({
      url: '../conference/conference?id=' + postad,//传递参数
    })
  },
  onLoad:function(){
    var that = this;
    wx.showToast({
      title: '加载中···',
      icon:"loading",
      duration:10000
    }),
    wx.request({
      url: APP_URL,
      method:'GET',
      data:{},
      header:{
        'content-type':'application/json'
      },
      success:(res)=>{
        wx.hideToast();
        var data = res.data.data;
        that.setData({
          conference:data.activity,
          industy:data.industy
        })
        console.log(this.data.conference)
      }
    })
  }
})

